package com.oamicnet.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class IndexController {

    @GetMapping("/index")
    public String index(@RequestParam("name") String name, Model model) {
        System.out.println("name: " + name);
        model.addAttribute("name", name);
        return "index";
    }

    @GetMapping("/hello")
    public String hello(Model model) {
        return "index";
    }
}
